package com.bnz.manager.service.impl;

import com.bnz.utils.PageUtils;
import com.bnz.utils.Query;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.bnz.manager.dao.SellerDao;
import com.bnz.manager.entity.SellerEntity;
import com.bnz.manager.service.SellerService;


@Service("sellerService")
public class SellerServiceImpl extends ServiceImpl<SellerDao, SellerEntity> implements SellerService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SellerEntity> page = this.page(
                new Query<SellerEntity>().getPage(params),
                new QueryWrapper<SellerEntity>()
        );
        
        return new PageUtils(page);
    }

	/**
	 * 2. 状态审核
	 * @param sellerId
	 * @param status
	 */
	@Override
	public void updateStatus(String sellerId, String status) {
		SellerEntity entity = new SellerEntity();
		entity.setSellerId(sellerId);
		entity.setStatus(status);
		baseMapper.updateById(entity);
	}

}